package com.youlu.campus.web.user.service;

import com.youlu.campus.entity.UserOtherInfo;
import com.youlu.campus.entity.UserPO;
import com.youlu.campus.entity.VO.req.CheckMobileVO;
import com.youlu.campus.entity.VO.req.WechatH5CodeReqNewVo;
import com.youlu.campus.entity.VO.req.WechatH5CodeReqVO;
import com.youlu.campus.entity.VO.res.UserResponse;
import com.youlu.campus.web.university.dto.UniversityResponse;
import com.youlu.campus.web.user.dto.request.DecryptRequest;
import com.youlu.campus.web.user.dto.request.UserHomeRequest;
import com.youlu.campus.web.user.dto.request.UserInfoRequest;
import com.youlu.campus.web.user.dto.response.UserHomeResponse;

/**
 * C端用户接口
 *
 * @author: zgz
 * @date: 2020/10/31 14:00
 */
public interface UserService {

    /**
     * 新增用户
     *
     * @param userPO
     * @return
     */
    UserPO insert(UserPO userPO);

    /**
     * 解密用户信息
     *
     * @param decryptRequest
     * @return
     */
    UserPO decrypt(DecryptRequest decryptRequest);

    /**
     * 根据openId查询用户信息
     *
     * @param openId
     * @return
     */
    UserPO queryUserByOpenId(String openId);

    /**
     * 根据id查询用户信息
     *
     * @param id
     * @return
     */
    UserPO queryUserById(String id);

    UserInfoRequest getUserInfo();

    UniversityResponse userInfoPerfect(UserInfoRequest userInfo);

    UserHomeResponse userInfo(UserHomeRequest request);

    /**
     * 获取微信H5 Code
     *
     * @return
     */
    String getWechatH5CodeByAppId(WechatH5CodeReqVO req);

    /**
     * 获取微信H5 Code
     *
     * @return
     */
    String getWechatH5CodeUrlByAppId(WechatH5CodeReqNewVo req);

    String authorizeCode(WechatH5CodeReqVO req);

    /**
     * 获取微信H5的AccessToken
     *
     * @param code
     * @return
     */
    UserResponse getWechatH5AccessToken(String code, String appId, String activityId, Integer type, String scope, Integer rewardType, String extension,
                                        String version);


    boolean checkMobile(CheckMobileVO req);

    /**
     * 发送手机号验证码
     *
     * @param req
     * @return
     */
    boolean sendSms(CheckMobileVO req);

    /**
     * 获取重定向
     *
     * @param wxAppId
     * @param activityId
     * @param type
     */
    String getWechatH5Code(String wxAppId, String activityId, Integer type, String scope,
                           Integer rewardType, String extension, String version);

    String getAccessTokenPreFix(String appId, String openId);

    /**
     * 手机验证码登陆
     *
     * @param req
     * @return
     */
    UserResponse codeLogin(CheckMobileVO req);

    /**
     * 修改基本信息
     */
    boolean updateUserInfo(UserOtherInfo userOtherInfo, String platform);


    void updateQQMiniOtherInfo(UserOtherInfo u);

    /**
     * 修改用户信息
     *
     * @param req
     */
    void updateUserInfo(UserPO req);
}
